home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)W / (A)W1.ADF / wordwright62.doc < prev    next >
Text File  |  1989-07-02  |  66KB  |  1,292 lines

  1. ┤3 to tmargin
  2. 6 to bmargin
  3. 63 to footer-line
  4. 40 to page-pos
  5. 7 to lmargin
  6. 5 to rmargin
  7. 15 to indent
  8. 78 to columns/line slow▓
  9. αINTRODUCTION TO WORDWRIGHT 
  10. ┤"Wordwright documentation" to footer-string▓
  11. ╖     Wordwright is made up of a collection of four integrated packages,
  12. a word processor, an outliner, mail merge, and a set of general purpose
  13. utilities. A few of the more unusual features of Wordwright are listed
  14. below.
  15.  
  16.      1. Wordwright is fast enough that characters may be entered at the
  17. beginning of a forty page document as fast as the auto repeat feature of
  18. the Amiga allows with no noticable slowdown.
  19.  
  20.      2. A table of contents may be generated automatically.
  21.  
  22.      3. Cursor control is accessable from both the keyboard and the
  23. mouse. A scroll bar is included to allow easy movement over long
  24. distances.
  25.  
  26.      4. User definable macros allow common phrases to be entered with a
  27. single keystroke.
  28.  
  29.      5. Calculations may be embedded within text. Conditional statements
  30. allow the value of a flag or calculation at print time to determine
  31. which of two phrases to print.
  32.  
  33.      6. Extensive use of color is made to distinguish between commands
  34. and text, highlight strings found in the search mode, etc.
  35.  
  36.      7. An outliner is included as an integral part of the word
  37. processor, allowing the user to expand and collapse either individual
  38. sections or all sections. This makes it easy to see the structure of the
  39. entire document as it is being written.
  40.  
  41.      8. The mail merge program allows multiple copies of a document to
  42. be made with automatic substitution of integer and string variables by
  43. data obtained from a merge file. In addition, decisions can be made
  44. concerning whether to print a letter or not based on tests made at print
  45. time. For example, if data in the merge file contains information
  46. concerning the employees of a company, it is possible to write a form
  47. letter to just those employees in a particular department.
  48.  
  49.      9. A utilities window contains a decimal or hexadecimal calculator,
  50. a dump utility which can dump any area of memory in both hexadecimal and
  51. ascii, and access to all DOS utilities.
  52.  
  53.      10. A screen saver turns off the screen after several minutes with
  54. no input from the keyboard.
  55.  
  56. αCHAPTER 1: GETTING STARTED 
  57.  
  58.      This first chapter describes a few of the basics that must be
  59. mastered before you can do anything usefull with Wordwright. After you
  60. have mastered this chapter, there is no reason to read the documentation
  61. in the order in which it is written and you are encouraged to jump
  62. around from one topic to another as your interest dictates. The
  63. information in this chapter though is of such importance that you should
  64. at least master this chapter before going any further.
  65.  
  66. ßBACKUP PROCEEDURE 
  67.  
  68.      The first thing that you should do when you receive any software is
  69. to make a backup. The instructions for making backups are included in
  70. the documentation that came with the Amiga. I strongly recomend that you
  71. make at least two backups and keep them in separate locations. The 3 1/2
  72. inch disks which the Amiga uses have such a high density that a very
  73. slight difference in alignment between the disk drive used to write the
  74. information and the drive used to read the information will cause the
  75. disk to be unreadable. Since the disk which I supply was created on a
  76. different drive than the one which you are using to read it, the disk
  77. which I supply will generaly be less reliable than one which is created
  78. on your own disk drive.
  79.      I have noticed that software which I receive from Commodore can be
  80. read from drive 0 but not from drive 1 on my system even though disks
  81. that I create with drive 0 can usually be read from drive 1 without any
  82. problems. Because of alignment problems, it is my policy to use drive 1
  83. only for reading and all writing takes place on drive 0.
  84.  
  85. ßMAKING A CLI DISK 
  86.  
  87.      The Amiga actually comes with two different operating systems.
  88. Workbench, the operating system which normally boots up when you first
  89. get your Amiga is built on top of another operating system called the
  90. CLI for Command Line Interface. The CLI operating system is far more
  91. powerfull than the Workbench and is a more traditional operating system
  92. than the Workbench. The Workbench operating system is essentialy a
  93. subset of the CLI which has been modified to work by selecting icons
  94. with the mouse instead of typing commands from the keyboard. In addition
  95. to the fact that the Workbench contains only a subset of the commands
  96. available from the CLI, it also takes up more memory because it is so
  97. graphics oriented.
  98.      Wordwright was intended for advanced users who want the maximum
  99. utility and are willing to pay the small price of typing commands
  100. instead of pointing at icons. For this reason, it is written to run
  101. under CLI instead of Workbench.
  102.      A CLI disk may be made from a Workbench disk by the following
  103. steps.
  104.      1. Use Preferences to enable the CLI and save the updated
  105. selections.
  106.      2. Reboot the system. The "System" drawer will now contain the CLI
  107. icon. Select it to get into the CLI operating system.
  108.      3. Edit the ╨file "S:Startup-Sequence", removing the lines with the
  109. commands "LoadWB" and "endcli > nil:". The file may be edited either by
  110. Ed (the editor that came with the Amiga) or by Wordwright. The disk will
  111. now boot up with the CLI instead of Workbench.
  112.      4. Erase any files which aren't needed.
  113.  
  114. ßSTARTING WORDWRIGHT 
  115.  
  116.      Once you have the CLI running, you can look at the directory of the
  117. disk which came with Wordwright by using the "DIR" command as shown in
  118. the "AmigaDOS User's Manual". In addition to the executable file which
  119. is labled "Wordwright", there are also some sample text files to help
  120. you get started. Start Wordwright by running the command "Wordwright".
  121. After you type "Wordwright" the computer will respond by opening a
  122. window labled "UTILITIES". It will then display the copyright notice and
  123. type a prompt (the greater than symbol ">"). The prompt indicates that
  124. the computer is waiting for user input.
  125.      There are a wide variety of commands available in the "UTILITIES"
  126. window, but the one of concern at this time is the command "edit". If
  127. you still remember the name of a text file, you may read it into the
  128. edit buffer and start editting with the command "edit filename" where
  129. "filename" is the name of the documentation file. If you don't remember
  130. the name, type "dir" just as if you were still using the normal CLI.
  131. This command will open up a new CLI and display the directory. After you
  132. have found the filename you may return to the "UTILITIES" window by
  133. hitting the return key. Once you have the file displayed you may begin
  134. playing with the various commands as shown in the rest of the
  135. documentation.
  136.      You will probably want to read the entire documentation file
  137. eventually, but for now, just jump from one command to another until you
  138. get a feel for the commands which interest you the most. As long as you
  139. have your backup copy stored in a safe place there's really no way to
  140. cause any damage by hitting the wrong key. The only thing you should be
  141. aware of at this time is that the print command will probably cause your
  142. printer to behave strangely until you have customized Wordwright for
  143. your particular printer. As soon as you have familiarized yourself with
  144. the editor, you should see the section entitled "INITIAL PRINTER SETUP"
  145. to see how this is done.
  146.  
  147. ßSTARTING A NEW FILE 
  148.  
  149.      If you want to start a new file, you must first determine whether
  150. you are in the utilities mode or the edit mode. The mode is indicated by
  151. the name of the window. If it says "UTILITIES" you are in the utilities
  152. mode. If it says "WORDWRIGHT" you are in the edit mode. If you are in
  153. the utilities mode all you have to do is type the word "edit" followed
  154. by the return key. This will clear the edit buffer and put you in the
  155. edit mode.
  156.      If you are already in the edit mode, type the escape key to get
  157. into the utilities mode and then type "edit". I have predefined the
  158. function key F10 so that it types the word "edit " with a single
  159. keystroke. Unless you redefine F10 as explained in the section on
  160. macros, you may thus start a new file from the "UTILITIES" window by
  161. typing the two keys F10 and return, or you may start a new file from the
  162. edit window by typing the three keys escape, F10, and return.
  163.      If you ever type the escape key from Wordwright either accidentally
  164. or to use the utilities mode for some purpose, you may return to the
  165. file from which you came by just typing ^E. (Hold the control key down
  166. and type the letter "e".)
  167.  
  168. ßREADING FILES 
  169.  
  170.      Files may be read in either of two ways. If you are in the
  171. utilities mode, the file may be read in at the same time the edit mode
  172. is involked by just typing the file name after the "EDIT" command. For
  173. example, to edit the file "SAMPLE.TXT", you would type "EDIT
  174. SAMPLE.TXT". If you are already in the edit mode, you may read in a new
  175. file by using the pulldown menu named "FILES". In this case, you will be
  176. given the option of reading in a new file and overwriting any file which
  177. is currently in the edit buffer or appending the new file to the end of
  178. the file currently being edited. After the menu selection is made, the
  179. computer will prompt you for the filename.
  180.  
  181. ßSAVING FILES 
  182.  
  183.      A file is saved by selecting the "SAVE" option from the "FILES"
  184. pulldown menu. When the computer prompts for the filename to use in
  185. saving the file, it will suggest using the name of the last file which
  186. was read. If this is acceptable, just type "RETURN" or "ENTER" and the
  187. computer will append the suffix ".BAK" to any file which has that name
  188. and then use that name for the new file. Wordwright will never delete a
  189. file unless it has the suffix ".BAK", ensuring that there is always at
  190. least one backup. It is also a good practise to keep a recent backup of
  191. any valuable file on a separate disk which is not stored near the
  192. computer.
  193.      If you ever accidently select the "READ" option from the "FILES"
  194. menu when you intended to save a file, just type "RETURN" with no file
  195. name and the computer will abort the read attempt without destroying the
  196. file which you were editing.
  197.  
  198. ßPRINTING FILES 
  199.  
  200.      A file may be printed by selecting the "PRINT" item from the
  201. "FILES" menu. There are two options allowed from the menu. You may print
  202. from the start of the file or from the current cursor position. In
  203. either case you must supply some information before the computer starts
  204. printing. The computer will first prompt you for the name of a merge
  205. file if one is used.
  206.      A merge file is used to supply data which is inserted into form
  207. letters. A description of how to use this feature is given in the
  208. chapter on mail merge. For normal text editing, the merge file doesn't
  209. apply and you may just respond with a carriage return.
  210.      The next prompt is a question asking whether to send the text to
  211. both the printer and the screen or just to the screen. It is sometimes
  212. usefull to send the text to just the screen in order to see how the
  213. document will be formatted.
  214.      If text is being sent to the printer as well as to the screen, you
  215. will be asked for the number of copies to print. You may either enter
  216. the number of copies that you want and then type a carriage return or
  217. you may just hit carriage return. If you just hit carriage return
  218. without telling the computer how many copies you want, the computer will
  219. assume that you just want one copy.
  220.      Whenever the computer asks for input but is capable of selecting a
  221. reasonable responce of its own when no input is supplied, the input
  222. which the computer can supply is called the default responce. Thus the
  223. default value for the number of copies desired is one.
  224.      The printing may be paused and restarted by hitting the space bar
  225. or may be aborted altogether by hitting the return key.
  226.  
  227. ßLEAVING WORDWRIGHT 
  228.  
  229.      You may leave Wordwright at any time either by hitting the escape
  230. key or selecting the quit gadget in the upper left corner of the window.
  231. This will return you to the "UTILITIES" window where you may use the
  232. utilities provided or return to the operating system by typing "quit".
  233. If you want to return from the "UTILITIES" window to the file which you
  234. were editing, just type ^E and the return key. You will return to the
  235. edit mode, the file will be redisplayed, and the cursor will be moved to
  236. the same location it was at when you left the edit mode.
  237.  
  238. ßINITIAL PRINTER SETUP 
  239.  
  240.      Wordwright allows the user to set the control codes which are sent
  241. to the printer in order to change fonts, begin underlining, change
  242. between draft mode and letter mode, or any other special function which
  243. the user desires. To make these changes, the user simply types the
  244. command "SETUP" from the "UTILITIES" window. A series of command strings
  245. will then be displayed and the user will be asked whether each string is
  246. correct for the indicated function. Whenever the user indicates that the
  247. string is incorrect, the computer will ask for the correct sequence.
  248. When all of the command strings are correctly set for your printer, you
  249. will be asked for a filename to use when saving the updated version. Any
  250. filename is acceptable, but my suggestion would be something short and
  251. simple like "WW" since editing programs and writing text are the most
  252. common applications used on any computer.
  253.  
  254. ßPROBLEMS 
  255.  
  256.      I have tried to produce the best software that I am capable of and
  257. I am continually making improvements both in Wordwright and in the
  258. documentation for Wordwright. Unfortunately however, I haven't yet
  259. achieved perfection and there are still some problems which you should
  260. be aware of. I have listed some of the most common problems below with
  261. the solutions when solutions are known.
  262.  
  263.      Q. After editing some text, you leave the computer for about 5
  264. minutes. When you come back, the screen is blank.
  265.  
  266.      A. Wordwright contains a screen saver which automatically turns off
  267. the screen after 5 minutes of no activity. Hit any printable character
  268. on the keyboard and the screen will reappear.
  269.  
  270.      Q. W▓hen you start Wordwright, a message appears saying that the
  271. memory is too fragmented for Wordwright to run. As soon as you hit any
  272. key, the computer returns to the CLI.
  273.  
  274.      A. Wordwright is designed to handle large text files with all text
  275. being held in memory instead of on the disk because of speed
  276. considerations and because I have a lack of faith in the ability of the
  277. operating system to recover gracefully in the event of disk errors.
  278. Wordwright can be set up to edit files up to 128K bytes in length in a
  279. computer with 512K. This is about 40 pages of text. In addition to the
  280. memory required to hold text, Wordwright also requires a large area for
  281. the copy buffer, and the program itself takes up about 80K. I have thus
  282. had to take over a large portion of the memory which is not being used
  283. by the operating system in order to maximize the computer's utility as a
  284. word processor.
  285.      If another program has been run prior to using Wordwright, the
  286. operating system may have broken the availble memory into discontinuous
  287. fragments which are not of sufficient length to allow Wordwright to
  288. function properly. The operating system is not able to reconstruct
  289. continuous memory from the fragments and the computer must be restarted
  290. before Wordwright can be used.
  291.      If a large portion of memory is being used for other purposes such
  292. as a RAM disk or a clock that runs in the background, there may be
  293. insufficient memory left for Wordwright.
  294.      Some programs such as compilers are notorious for requiring a huge
  295. stack in order to run properly. It has thus become a common technique
  296. among programmers to include a line of code in the script file
  297. "STARTUP-SEQUENCE" which tells the computer to allocate a huge amount of
  298. stack space for each task. This will also cause the computer to have
  299. insufficient memory.
  300.      The "setup" command which is used to set up Wordwright for your
  301. printer allows you to set the amount of memory which is allocated for
  302. the text file. If you want to run other programs concurrently with
  303. Wordwright, you have the ability to create a version of Wordwright which
  304. will require less memory than I have allocated.
  305.      Due to the structure of the language which Wordwright was written
  306. in, Wordwright allocates its own stacks and makes no use of the stack
  307. which is allocated for it by the operating system. The 4K which is
  308. normally allocated for stacks is therefore more than adequate for
  309. Wordwright. If you want to try using an even smaller stack, you should
  310. first test the effect on other programs which you will want to run from
  311. Wordwright (DIR, INFO, DELETE, COPY, etc.).
  312.  
  313.      Q. When saving a file which has taken a couple of hours to produce
  314. you get a system message saying that the disk has an error. You are then
  315. asked whether you want to try again or abort the attempt. Regardless of
  316. what responce you make, the computer just keeps trying over and over
  317. again to save the file and will not allow you to abort the attempt or
  318. try with another disk.
  319.  
  320.      A. This is the most obnoxious problem that I have come across and I
  321. have no solution since the problem is in DOS itself and not in my
  322. software. When disks go bad there is very little that can be done to
  323. reconstruct the data. DON'T depend on "DISKDOCTOR"! Errors almost always
  324. occure on the track which is used to store the directory since this is
  325. the track which is used the most. "DISKDOCTOR" can generally save only a
  326. small portion of the disk.
  327.      Make sure you keep lots of backup copies of any important files. If
  328. your disk drives have a tendency to cause errors, it is a good idea to
  329. reformat your disks every once in a while even before they start to
  330. cause problems. My experience has shown that a disk which has been
  331. reformated recently is much more reliable than a disk which has never
  332. shown any problems but has been used several times without being
  333. reformatted.
  334.      It is also somewhat safer to print the document before trying to
  335. save it on a disk. This way you will at least have a hard copy in case
  336. the drive locks you out.
  337.  
  338.      Q. Wordwright just doesn't do what you want it to do.
  339.  
  340.      A. All software involves compromises. Wordwright was written to
  341. solve my needs and if your needs happen to be the same as mine, I
  342. believe that you will be very happy with it. If you have questions or
  343. needs which I haven't satisfied, give me a call.
  344.      If I have solved the problem since you bought your copy of
  345. Wordwright, I will send you the update at minimal cost. At the present I
  346. am not charging anything for updates. This may change in the future but
  347. I don't anticipate ever charging more than $5 to $10 for an update. In
  348. any case, I welcome feedback and many of the features which are
  349. contained in Wordwright now are the result of requests from my previous
  350. customers.
  351.      Wordwright also comes with a one year guarantee. If at any time
  352. within a year of purchase you decide that Wordwright doesn't satisfy
  353. your needs, send me a note saying that all copies of Wordwright have
  354. been destroyed and I will send a full refund. My address and phone
  355. number are shown below.
  356.  
  357.      RTL Programming Aids
  358.      10844 Deerwood SE
  359.      Lowell, MI   49331
  360.  
  361.      (616) 897-5672
  362.  
  363. αCHAPTER 2: THE EDITOR 
  364.  
  365.      Now that the basics are out of the way, the fun can begin! In this
  366. chapter you will learn how to move the cursor around, search for
  367. strings, define macros, and start actually using Wordwright. From this
  368. point on the features of Wordwright can be studied in any order that you
  369. want so don't be afraid to jump around a little. Use the features that
  370. you need and ignore the ones that you don't need. The important thing is
  371. to use Wordwright.
  372.  
  373. ßCURSOR CONTROL 
  374.  
  375.      There are a wide variety of ways to move the cursor. For large
  376. cursor movements, a scroll bar is included on the right margin. If
  377. Wordwright is set up so that 128K of memory is reserved for the text
  378. buffer, the entire length of the scroll bar represents 128K bytes of
  379. text. Thus for a 64K text file only the top half of the scroll bar is
  380. used. To move to the middle of a 64K file, you would use the mouse to
  381. point to the location of the scroll bar which is 1/4th of the way from
  382. the top and press the left mouse button. If you try to move past the end
  383. of the file, the cursor will move to the end of the file and the scroll
  384. bar indicator will move to the appropriate spot to indicate the
  385. percentage of the 128K which is used by the file.
  386.      For smaller movements the mouse can be used by pointing the mouse
  387. at the desired cursor position and pressing the left button. If the
  388. mouse is pointed at the first or last line of the screen, the computer
  389. scrolls in the appropriate direction.
  390.      Although the mouse is an excellant tool for moving the cursor
  391. arbitrary distances, the arrow keys are usually more convenient for
  392. moving short distances such as a single character or line. The unshifted
  393. up and down arrows are used to move to the begining of the line above or
  394. below the line which currently contains the cursor. The unshifted left
  395. and right arrows are similarly used to move one character to the left or
  396. right in the file.
  397.      If the shift key is held down while an arrow key is pressed, it
  398. modifies the behavior so that the up and down arrows move the cursor a
  399. screen at a time and the left and right arrows move a word at a time.
  400.      If the cursor is pointing to the right location of the document but
  401. is at the top or bottom of the screen, it is sometimes usefull to be
  402. able to rewrite the screen so that the line containing the cursor is in
  403. the center of the screen. This is done by hitting Cnt-N (for normalize).
  404.      Cnt-T and Cnt-B may be used to quickly move to the top and bottom
  405. of the file respectively.
  406.  
  407. ßSEARCH MODE 
  408.  
  409.      The search mode is entered by typing Cnt-S and is used to find a
  410. particular word or string. When the search mode is selected, the
  411. background color becomes lighter. If the background was black, it will
  412. become grey. If it was dark blue, it will become light blue. As each key
  413. is pressed the computer adds that character to the search string and
  414. searches for the first instance of that string. If the string is found
  415. the cursor moves to the string and the string is highlighted. If the
  416. string is not found the cursor remains where it is. When the search mode
  417. is first entered, all searches take place in the forward direction. The
  418. next instance of the string may be found by typing either the right
  419. arrow or the down arrow. The previous instance of the string may be
  420. found by typing either the left arrow or the up arrow. Whenever the
  421. direction is changed by typing one of the four arrow keys, the computer
  422. remembers the direction. If any additional characters are added to the
  423. search string to cause a new search to take place, the direction of the
  424. search will be the same as the last search.
  425.      Characters may be removed from the search string one at a time by
  426. typing the backspace key. When you want to leave the search mode and
  427. return to the normal mode, type the escape key (labled "ESC").
  428.  
  429. ßSEARCH AND REPLACE MODE 
  430.  
  431.      The replace mode is entered by typing ^R and is identical to the
  432. search mode except that the user is asked to type in a "replace string"
  433. before the computer enters the search mode. Once the replace string has
  434. been entered, type the "ENTER" or "RETURN" key to return to the text
  435. window and enter the search mode. The search mode is then used in the
  436. normal way to find and highlight strings. Each highlighted string may be
  437. replaced with the replace string by typing ^R (hold down the key labled
  438. "CTRL" while typing the upper or lower case letter "R").
  439.  
  440. ßGLOBAL SEARCH AND REPLACE 
  441.  
  442.      The replace mode which was just described is the safest way to
  443. replace one string with another string since in that mode, the computer
  444. allows the user to give confirmation before each string is replaced.
  445. When you are sure that every instance of a phrase should be changed,
  446. there is a much faster way of replacing the phrase.
  447.      The global search and replace command is involked by typing ^G.
  448. When ^G is typed the computer requests the user for the search string
  449. and the replace string. It then finds each instance of the search string
  450. and replaces it with the replace string.
  451.  
  452. ßEMBEDDED COMMANDS 
  453.  
  454.      Much of the power of Wordwright comes from the ability to embed
  455. commands in the text which will be executed when the document is
  456. printed. Commands are distinguished from normal text by the fact that
  457. commands are printed in yellow on the screen while normal text is
  458. printed in white. You can change the color to yellow in order to insert
  459. a command by typing Cnt-Y. When you want to return to the normal text
  460. mode, type Cnt-W to change the color back to white.
  461.  
  462. ßFORMATING COMMANDS 
  463.  
  464.      Formating is done according to the values contained in a number of
  465. variables which may be changed at any time by typing the appropriate
  466. command in yellow. The following variables are included:
  467.  
  468.      lmargin           left margin
  469.      rmargin           right margin
  470.      tmargin           top margin
  471.      bmargin           bottom margin
  472.      columns/line      columns per line
  473.      lines/page        lines per page
  474.      lf/cr             line feeds per carriage return
  475.                        (for single or double spacing)
  476.  
  477.      In addition to these variables, the following commands affect the
  478. way text is printed:
  479.  
  480.      tof               go to the top of form (next page)
  481.      section           if you are near the bottom of a page
  482.                        eject to the next page otherwise just
  483.                        insert a line feed.
  484.      Cnt-J             begin word wrap
  485.      Cnt-K             end word wrap
  486.      superscript       begin superscript
  487.      superscript-off   end superscript
  488.      subscript         begin subscript
  489.      subscript-off     end subscript
  490.      fast              draft mode
  491.      slow              letter quality mode
  492.  
  493. ßWORD WRAP 
  494.  
  495.      When a document is being written, it is usually important to have
  496. the maximum number of whole words on each line. This can become a
  497. problem when text is later edited and words are inserted into or deleted
  498. from the text. The result of inserting or deleting text can be some
  499. lines with only a few words on them and other lines which extend past
  500. the end of the screen (or past the right edge of the paper when the text
  501. is printed). Word wrap causes the computer to find the best places for
  502. line feeds so that the maximum number of whole words fit on each line
  503. without going over the maximum number of character which will fit on one
  504. line.
  505.      When word wrap is on, the computer will recalculate the proper
  506. position for line feeds as characters are inserted and deleted from the
  507. document. The display on the screen will be optimized for the best
  508. looking display which can be generated for the given window size and the
  509. size of the characters as selected by the "PREFERENCES" program.
  510.      Since the printer will often allow a different number of characters
  511. per line than the screen will allow, the locations of line feeds and
  512. spaces will be recalculated during the printing of text to correspond
  513. with the variables, lmargin, rmargin, and columns/line.
  514.      Word wrap can be turned on or off by hitting Cnt-J or Cnt-K
  515. respectively. Whenever Cnt-J is typed, the background changes to dark
  516. blue to give a visual indication that word wrap is turned on. Whenever
  517. Cnt-K is typed, the background changes to black to show that word wrap
  518. is turned off. It is possible to turn word wrap on and off several times
  519. at different locations of the text. In this case the background at
  520. different locations will be different colors so that it will always be
  521. obvious whether word wrap is on or off.
  522.      Word wrap is usually a desirable feature and will generally be used
  523. in all text except those portions of text when you specifically require
  524. the ability to determine the position of the line feeds yourself.
  525. Examples of these situations are the use of Wordwright to write computer
  526. programs or display columns of data. In the chapter on mail merge, it
  527. will be seen that merge files depend on the position of line feeds to
  528. distinguish between data items.
  529.  
  530. ßJUSTIFICATION 
  531.  
  532.      When the computer prints your document, it can either space the
  533. words as they are written on the screen or it can insert extra spaces
  534. between some words so that the right margin is straight. Aligning the
  535. right margin is called right justification. Right justification is
  536. closely associated with word wrap and is always turned off unless word
  537. wrap is turned on. In addition, right justification also depends on the
  538. variable "justify". Thus if the variable "justify" is true and word wrap
  539. is on, then right justification will occur, but if either "justify" is
  540. false or word wrap is off, justification will not occur. Publishers
  541. generally like to perform justification themselves and therefore prefer
  542. not to have justification done by the author.
  543.      The "justify" variable can be changed by the code "true to justify"
  544. or "false to justify". If you want the ability to go back and forth
  545. between these settings, you may include this code at the start of each
  546. document. If you will always use justification or will never use
  547. justification, you may enter this code from the utilities window and
  548. then run the setup command so that you may save the updated version of
  549. Wordwright. In this case Wordwright will always start with the correct
  550. setting of the "justify" variable.
  551.  
  552. ßPRINT STYLE 
  553.  
  554.      Italics, bold, and underlining are controled by toggling the
  555. desired functions with alternate keys. For example, to print a section
  556. in italics, you would place the cursor at the start of the section and
  557. type ALT-I (hold down one of the two the keys labled ALT and press the
  558. letter "I" or "i"). At this time all characters from the cursor until
  559. the next ALT-I will be changed to italics. You would then place the
  560. cursor at the end of the section and type another ALT-I to change back
  561. to normal characters.
  562.      Bold and underlining may be performed in an identical manner using
  563. ALT-B for bold and ALT-U for underlining. When any of these print styles
  564. are turned on or off a single character control code is inserted into
  565. the text. This control character is invisible on the screen except for
  566. its affect on the print style but it can be shown to exist in the text
  567. by its effect on the left and right arrow keys. If the cursor is at a
  568. control key and the right arrow is pressed, the screen will not change
  569. because the control code doesn't take any space on the screen. A control
  570. code may be erased with the delete key or the backspace key just like
  571. any other character and the screen will immediately be updated.
  572.  
  573. ßHANGING INDENT 
  574.  
  575.      It is sometimes desirable to have two alternate left margins and
  576. have the active left margin toggle back and forth between them. This
  577. technique is often used when creating a glossary and is called a hanging
  578. indent for reasons which are not known to me. The following example will
  579. show how a hanging indent is used.
  580.  
  581. OUTLINE MODEëA mode in which only chapter and section headings are
  582. displayed on the screen. This mode allows the user to see
  583. the overall structure of the document without all the
  584. distracting details. While you are in this mode, it is
  585. possible to move entire sections with the same ease that
  586. you would move sentences or paragraphs in the text mode.è
  587.  
  588.      A hanging indent is toggled on and off by typing Alt-M. In the
  589. example just shown, I started the hanging indent immediately after the
  590. words "OUTLINE MODE" and stopped it at the end of the indented
  591. paragraph. The variable "indent" is used to indicate how many spaces to
  592. adjust the left margin when the hanging indent is turned on. In the
  593. example just shown, I set "indent" to 15 so the paragraph is indented 15
  594. spaces to the right of the normal right margin. Since the new left
  595. margin is positioned relative to the normal left margin, the variable
  596. "lmargin" may be changed without affecting the hanging indent.
  597.  
  598. ßHEADERS AND FOOTERS 
  599.  
  600.      The variables "header-line" and "footer-line" are used to indicate
  601. which line to place a header or footer on. Whenever the printer gets to
  602. the appropriate line, a header or footer is printed. If you want the
  603. header to be printed on line 3 you would set the variable "header-line"
  604. to 3 with the command "3 to header-line". The command would have to be
  605. started with ^Y and ended with ^W to show the computer that this is a
  606. command and not just normal text. If you don't want a header or footer
  607. just set the variable "header-line" or "footer-line" to zero. Since the
  608. line numbers start at one, there will never be a match between the line
  609. number and the "header-line" or "footer-line".
  610.      The header will print the string contained in the string variable
  611. "header-string" which may be changed at any time with a command such as:
  612.  
  613.      "This is the new header string" to header-string
  614.  
  615.      As before, the command must be shown in yellow to be interpreted as
  616. a command. The footer behaves in a similar manner except that after the
  617. "footer-string" is printed, the printer moves to the column indicated by
  618. the variable "page-pos" and prints the page number. In order to number
  619. the pages on line 65, in column 39, with no footer message, you would
  620. start your text with the command:
  621.  
  622.      "" to footer-string 65 to footer-line 39 to page-pos
  623.  
  624. ßTABS 
  625.  
  626.      There are two ways to set tabs in Wordwright. The simplest way is
  627. to select the pull down menu labled "TABS". This will open a new window
  628. and will then prompt you for the correct tab settings. The weakness of
  629. this approach is that the tabs must be set manually each time the file
  630. is read in.
  631.      The second approach is to imbed commands within the text file
  632. itself. The commands available for setting tabs in this way are:
  633.  
  634.      clear-tabs           removes all tab settings
  635.      set-tab              set a tab
  636.      reset-tab            remove a tab
  637.  
  638.      The syntax for setting or removing a tab requires that the column
  639. number of the tab must preceed the command. In the next example,
  640. commands are shown which will set tabs at columns 10 and 20.
  641.  
  642.      clear-tabs 10 set-tab 20 set-tab
  643.  
  644.      If a form is being edited which has commands as shown above, the
  645. commands will be executed whenever the file is reformatted by typing ^A
  646. as well as when the text is printed.
  647.  
  648. ßBLOCK COPY 
  649.  
  650.      A copy buffer is used to store text which is to be copied to a
  651. different location. Text is placed in the copy buffer by one of two
  652. ways. Whenever a block of text is deleted by use of the delete mode or
  653. by the block delete command, the text is placed in the copy buffer as a
  654. safety feature to allow the recovery of the text if it is deleted
  655. erroneously.
  656.      A second method of placing text in the copy buffer is to mark each
  657. end of the block by placing the cursor there and typing ^X. The
  658. background color will change to green when the first ^X is typed and
  659. will return to normal when the second ^X is typed.
  660.      Once text is placed in the copy buffer, as many copies as are
  661. needed may be inserted into the file by placing the cursor in the
  662. desired positions and typing ^C.
  663.  
  664. ßBLOCK DELETE 
  665.  
  666.      A block may be deleted by marking the beginning and end of the
  667. block with ^X as described above in the section concerning copying of a
  668. block. After the block is marked and before any other key is pressed a
  669. third ^X may be entered to delete the block. If any other key is pressed
  670. between the second and third entry of the ^X, the block will not be
  671. deleted and the ^X will be interpreted as the first ^X in another
  672. attempt to mark a block of text and the computer will indicate this by
  673. changing the background color to green. If a ^X is entered in error and
  674. you don't want to lose the text which is already in the copy buffer,
  675. enter a second ^X without moving the cursor. When a block of zero length
  676. is marked in this way, the computer recognizes this as a mistake and the
  677. copy buffer isn't changed.
  678.  
  679. ßBLOCK MOVE 
  680.  
  681.      A block of text may be moved from one area to another area by
  682. combining the proceedure for the block delete with the proceedure for
  683. the block copy. The block to be moved is first deleted. Before any other
  684. block deletes are made the cursor is moved to the desired location of
  685. the block and a copy is placed there by typing ^C.
  686.  
  687. ßDELETE MODE 
  688.  
  689.      The delete mode allows a fast way of deleting words or lines of
  690. text. The delete mode is entered by typing ^D. While in the delete mode,
  691. the characters are changed to a particularly ugly shade of pink (chosen
  692. for good contrast not beauty) and the cursor will begin to flash on and
  693. off. In this mode the arrow keys are interpreted as special delete keys.
  694. The up and down arrows are used to delete text from the cursor to the
  695. end of the previous line or the beginning of the following line
  696. respectively. The left and right arrows are used to delete to the
  697. beginning of the previous or following word. The computer will return to
  698. the normal mode if any key except one of the arrow keys is pressed. It
  699. will also return to normal mode after about two seconds without a key
  700. being pressed.
  701.      The text which is deleted while in the delete mode is saved in the
  702. copy buffer in case an error is made and replaces the text which was in
  703. the copy buffer.
  704.  
  705. ßMACROS 
  706.  
  707.      The 10 function keys are available as user definable macros. In
  708. order to see how the macros are currently defined or to change the macro
  709. definitions, you must select the macros option from the "MISC" pull down
  710. menu of Wordwright. The current definitions of the macros will be
  711. displayed and you will then be given the oportunity to change any macro.
  712.      To change a macro, just hit the function key which you want to
  713. redefine. As soon as this is done, the computer will prompt you for the
  714. string to be associated with that macro. After the string is typed in,
  715. the macro definition is finished by typing the escape key. When a macro
  716. has been defined, the macro definitions will be redisplayed and you will
  717. again be given the oportunity to change macro definitions. When no more
  718. changes are desired you may return to Wordwright by typing the escape
  719. key when you are asked to type a function key.
  720.      Any characters may be included in the macro definition except the
  721. escape key which is used to end the macro. Although macros are generally
  722. used to type frequently used text, it is also possible to define a macro
  723. as a sequence of commands. For example, a command to move the cursor
  724. down 3 screens and then search for the first instance of the word "the"
  725. could be defined as a macro by holding the shift key down, hitting the
  726. down arrow key 3 times, typing control S, and following with the word
  727. "the".
  728.      It should be noted that some keys such as the arrow keys emit a
  729. string of characters starting with the special control sequence
  730. introducer 9B hex. Since this byte doesn't have a printable ascii
  731. representation, the byte 9B is represented by a tilde (~) when the macro
  732. definitions are displayed.
  733.  
  734. ßHELP 
  735.  
  736.      The help key is used while in Wordwright to provide on line help in
  737. the form of information screens which summarize the commands which are
  738. associated with the various control characters and display information
  739. such as the current macro definitions. To use the help key, just hit it
  740. while in the edit mode.
  741.  
  742. αCHAPTER 3: THE OUTLINER 
  743.  
  744.      In addition to the word processing capabilities of Wordwright, an
  745. integrated outliner is also included. The power of an outliner becomes
  746. very apparent when a large document is being written. In the same way
  747. that a word processor allows you to easily move words and phrases around
  748. so that your sentences become clear and easy to read, an outliner
  749. enables you to move entire sections around and clarify the structure of
  750. an entire document.
  751.  
  752. ßOPENING AND CLOSING SECTIONS 
  753.  
  754.      The basic feature that gives an outliner its usefulness is the
  755. ability to shrink and expand sections. By shrinking all the sections so
  756. that only the section titles are shown, it is possible to shrink the
  757. text file by perhaps a 15 to 1 ratio for a clear overview of the
  758. structure of your document.
  759.      Cnt-F is used as a toggle to either shrink or expand an individual
  760. section. If the cursor is at a closed section when Cnt-F is pressed, the
  761. section will be expanded. If the cursor is at an open section when Cnt-F
  762. is pressed, the section will collapse so that only the section title is
  763. shown and the cursor will be moved to the beginning of the section
  764. title.
  765.      Cnt-O (the letter not the number) is similar to Cnt-F except that
  766. its effects are global. In other words, if the cursor is at an open
  767. section all sections will be closed and if the cursor is at a closed
  768. section, all sections will be expanded.
  769.  
  770. ßCURSOR CONTROL 
  771.  
  772.      The outliner is integrated with the rest of the word processor in
  773. such a way that cursor control is identical in both the text mode and
  774. the outline mode and is independent of whether sections are open,
  775. closed, or a combination of the two. This includes cursor control both
  776. by the mouse and by the keyboard.
  777.      It is usually much easier to learn by example than it is by just
  778. reading so you are encouraged to try editing a text file at this time
  779. and experiment with opening and closing sections and moving the cursor
  780. while in the outline mode. The unshifted up and down arrow keys will
  781. still move the cursor a line at a time and the shifted up and down arrow
  782. keys will still move the cursor a screen at a time. However, since each
  783. line displays an entire section in the outline mode, the cursor will
  784. move a much greater distance in relation to the size of the file.
  785.      This can be seen clearly by noticing the effect of cursor movement
  786. on the scroll bar. Moving up or down a single line in the text mode will
  787. hardly move the scroll bar indicator. However, moving up or down a
  788. single line while in the outline mode can cause the indicator to move
  789. quite a large distance if the sections are large.
  790.      You should also try moving the cursor by means of the mouse. In
  791. this case, the cursor will again behave in a similar manner independent
  792. of whether the screen is displaying the file in the text mode, the
  793. outline mode, or some sections in each mode.
  794.      If you enter the search mode and the computer finds a string in a
  795. closed section, the section will be opened automatically so that the
  796. string can be displayed. This is also true for text which is found by
  797. moving the scroll bar.
  798.      A block of text may be moved, deleted or copied in either the
  799. outline form or the text form. If you are in the outline mode and a line
  800. of text is deleted by entering the delete mode and hitting an up or down
  801. arrow key, an entire section can be deleted at one time. If this is done
  802. by mistake, the entire section can be recovered by typing Cnt-C just as
  803. it would be in the text mode.
  804.  
  805. ßSTARTING A NEW SECTION 
  806.  
  807.      In order to use the outliner, each section header should be
  808. highlighted on the screen. Wordwright allows a section header to be
  809. highlighted by placing the cursor anywhere on the section header,
  810. holding down one of the two keys labled "ALT", and pressing the letter
  811. "S" (for Section). This will cause the section to be shown in inverse
  812. video on the screen.
  813.      If the cursor is placed at a section title which is already shown
  814. in inverse video and the Alt-S is pressed, the section will be indented
  815. two spaces for each time Alt-S is typed. This indicates that the title
  816. refers to a subsection.
  817.      In order for your document to look right, you must ensure that the
  818. title of a section is never on one page and the begining of the text on
  819. the next page. Wordwright will prevent this from happening as long as
  820. the title of the section is written in inverse on the screen.
  821.      When a text file is printed, there is a distinction between
  822. sections that are indented and sections that aren't indented. Any
  823. section which is not indented will always start on a new page. This is
  824. therefore generally used for the beginning of a chapter. If the section
  825. is indented, it makes no difference how many levels it is indented
  826. except for its appearence in the outline. Indented sections will start
  827. at whatever location of the page you happen to be at as long as there is
  828. sufficient space on the page to include the section title and at least
  829. two lines of text. If you are too close to the bottom of the page for
  830. this to be possible, the printer will eject to the top of the next page
  831. before it starts the section.
  832.      The indentation is only shown on the screen to make the outline
  833. easier to understand. No indentation will occure on the paper unless
  834. spaces are typed into the section title by pressing the space bar.
  835.  
  836. ßTABLE OF CONTENTS 
  837.  
  838.      A table of contents may be generated automatically by simply typing
  839. the command "contents" in yellow as the last command in your text. As a
  840. document is being printed, Wordwright keeps track of the page where each
  841. section starts. The command "contents" causes the computer to use this
  842. information to generate a table of contents. Since the computer won't
  843. know what page each section starts on until after the document is typed,
  844. it is important that the "contents" command be the last command given in
  845. the document.
  846.  
  847. αCHAPTER 4: MAIL MERGE 
  848.  
  849.      I hardly ever go more than a month without receiving a "personal"
  850. letter from some computer telling me what a great guy I am and how lucky
  851. I am to be one of the few priveliged people selected to receive the
  852. latest marvel of science for only $19.95 plus $3.00 for shipping and
  853. handling. The letter will invariably mention me by name at least once
  854. and it will also include some other personal information such as my
  855. address to show that the letter was written by someone who really cares
  856. about me.
  857.      Mail merge allows you to write very complicated form letters in
  858. which the exact wording is modifed by data taken from a separate file
  859. called the merge file.
  860.  
  861. ßVARIABLES 
  862.  
  863.      Two types of variables are supported in Wordwright, integer
  864. variables and string variables. Each variable must be defined before it
  865. is used with one of the defining words declare or declare-string. The
  866. syntax for these commands is shown by the examples below. It is
  867. important to remember that commands must be shown in yellow on the
  868. screen or they will be interpreted as normal text.
  869.  
  870.      declare gross-sales
  871.      declare-string first-name
  872.  
  873.      In each case the defining word is followed by the name of the
  874. variable which is being defined. The two types of variables have
  875. different properties and will therefore be treated seperately in the
  876. following sections. Any variable which is defined in a text file is a
  877. local variable. This means that the variable will be removed as soon as
  878. you leave Wordwright and any space which was reserved for the variable
  879. will be returned.
  880.  
  881. ßINTEGER VARIABLES 
  882.  
  883.      Integer variables are 32 bits in length. This gives a range of more
  884. than 2 billion in both the positive and negative directions. When a
  885. variable name is encountered the computer normally returns the value
  886. which is contained in that variable. For example if the variable "age"
  887. has been declared and set to 10 the code "age =" would print the number
  888. 10. The action of a variable may be changed by immediately preceeding it
  889. with the word "to" or "+to". The word "to" is the assignment operator.
  890. This causes a number to be assigned to a variable. The code "25 to age"
  891. would assign a value of 25 to the variable "age". The word "+to" behaves
  892. in a similar manner, but instead of assigning a fixed value to the
  893. variable, it adds to the number which was already in the variable. If
  894. the variable "age" had the value 25, the code "3 +to age" would change
  895. the value of "age" to 28.
  896.  
  897. ßSTRING-VARIABLES 
  898.  
  899.      Each string variable may hold a string up to 50 characters in
  900. length. When a string is encountered, the normal behavior is to return
  901. the address where the string is located. The command "print" is used to
  902. print a string from its address. If the string variable "animal" is
  903. declared and the string "cat" is assigned to "animal", the code "animal
  904. print" will print the word "cat". Like the integer variables previously
  905. discussed, the behavior of a string is also dependent on whether it is
  906. preceeded by the word "to" or "+to". In this case "to" is used to assign
  907. a string to the variable and the word "+to" is used to append a string
  908. to a string which was already contained in the variable.
  909.      Since examples are often more instructive than explanations, the
  910. following example is offered to show how a string variable is modified
  911. by various commands. The left column shows the commands and the right
  912. column shows what would be printed as a result of each command. Again,
  913. remember that in order to distinguish between commands and text, the
  914. commands must be printed on the screen in yellow and normal text must be
  915. printed on the screen in white. The control characters ^Y and ^W are
  916. used to change the color of the text. ╡
  917.  
  918. declare-string name
  919. declare-string street
  920. declare-string city
  921. declare-string state
  922.  
  923. "RTL Programming Aids" to name
  924. "10844 Deerwood SE" to street
  925. "Lowell" to city
  926. "MI" to state
  927.  
  928. name print                             RTL Programming Aids
  929. street print                           10844 Deerwood SE
  930. city print ", " print state print      Lowell, MI
  931. ßDECISIONS 
  932.  
  933.       In order to be as flexible as possible, the computer must be able
  934. to make choices and perform different tasks under different
  935. circumstances. This requires two things. First there must be a variety
  936. of instructions which are capable of making comparisons or returning
  937. various types of status information, and second there must be control
  938. structures which are capable of making different responses as a result
  939. of these instructions. The next two sections will show how to alter the
  940. way a document is printed based on conditions which are encountered
  941. during the printing of the document.
  942.  
  943. ßTESTS AND COMPARISONS 
  944.  
  945.      The purpose of a test or comparison instruction is to return a
  946. flag. A flag can be thought of as a switch which represents a true or
  947. false condition. There are 6 different comparisons which can be made
  948. between numbers and 3 comparisons which can be made between strings. The
  949. following is a summary of the comparison instructions.
  950.  
  951.      NUMERIC COMPARISONS          STRING COMPARISONS
  952.  
  953.      greater-than                 $greater-than
  954.      greater-or-equal             $equal
  955.      equal                        $less-than
  956.      not-equal
  957.      less-than
  958.      less-or-equal
  959.  
  960.      In each test the arguments being tested preceed the test itself.
  961. THIS IS EXTREMILY IMPORTANT. The program will not operate correctly if
  962. the order is changed. For example, if the variable "age" contains the
  963. age of a person, you could determine whether the person is 21 years old
  964. or greater with the code "age 21 greater-or-equal".
  965.  
  966. ßCONTROL STRUCTURES  
  967.  
  968.      The simplest control structure is the IF ... ENDIF structure.
  969. Because Wordwright uses postfix notation, this structure behaves a
  970. little bit differently than the same structure in some computer
  971. languages. It is assumed that a flag indicating a true or false
  972. condition has been generated prior to entering this control structure.
  973. Any nonzero number is considered a true flag and a zero is considered to
  974. be a false flag. When the word IF is encountered the flag is tested to
  975. see whether it is true or false. The flag is then dropped and execution
  976. either proceeds with the next sequential instruction (if the flag was
  977. true) or execution jumps to the word immediately following the word
  978. ENDIF.
  979.  
  980.      In the example just given, there was no response for the case when
  981. the comparison instruction returned a false flag. Many times, there is
  982. one procedure in the case of a true flag and an alternate procedure in
  983. the case of a false flag. The IF ... ELSE ... ENDIF construct may then
  984. be used.
  985.      The IF ... ELSE ... ENDIF construct tests the flag in the same way
  986. as the IF ... ENDIF construct. It then executes the clause between IF
  987. and ELSE in the case of a true flag and the clause between ELSE and
  988. ENDIF in the case of a false flag. After the appropriate clause is
  989. executed, execution proceeds with the word immediately following the
  990. word ENDIF.
  991.  
  992.      For those people who are familiar with the IF THEN and IF THEN ELSE
  993. constructs of BASIC, it is important to compare the differences between
  994. the BASIC version and the Worwright version of this structure. It isn't
  995. obvious at first glance, but the BASIC control structures should
  996. actually be written as IF ... THEN ... ENDIF and IF ... THEN ... ELSE
  997. ... ENDIF. The word ENDIF is not explicitly included in BASIC, but is
  998. implied by the end of the line. This means that the BASIC version of
  999. this control structure can never have a clause longer than one line and
  1000. the only way to get around this arbitrary limitation is to include
  1001. commands such as GOTO or GOSUB in clauses which are too long otherwise.
  1002.      Another difference is the fact that Wordwright requires the
  1003. conditional flag to be determined and placed on the stack before
  1004. entering the control structure. BASIC determines the condition from code
  1005. placed between the words IF and THEN. If the conditional clause is
  1006. indicated by COND?, the syntax of the two versions can be compared as
  1007. follows (with the implied ENDIF of BASIC displayed).
  1008.  
  1009. Wordwright
  1010.  
  1011.  COND? IF ... ENDIF
  1012.  COND? IF ... ELSE ... ENDIF
  1013.  
  1014. Basic
  1015.  
  1016.  IF COND? THEN ... ENDIF
  1017.  IF COND? THEN ... ELSE ... ENDIF ┤tof▓
  1018.  
  1019. ßFORM LETTERS 
  1020.  
  1021.      In the following examples, embeded commands are used to show how a
  1022. form letter may be written which will print different phrases based on
  1023. the values of variables which are defined at the beginning of the
  1024. letter. Both of the letters which follow were printed using the same
  1025. form letter. The only change is the values assigned to the variables.
  1026.  
  1027. ┤declare current-gross
  1028. declare past-gross
  1029. declare gross-increase
  1030. declare-string scapegoat
  1031.  
  1032. 380000 to current-gross
  1033. 326000 to past-gross
  1034. current-gross past-gross - to gross-increase
  1035. "our newest employee" to scapegoat
  1036. "Z,ZZZ" to format
  1037.  ▓
  1038. ╖Dear Stockholder,
  1039.  
  1040.      The gross sales for this quarter was $┤current-gross =▓. This is
  1041. ┤gross-increase neg?- if "a decrease" else "an increase" endif print▓ of
  1042. ┤gross-increase abs "$" print =▓. This change in gross sales is due
  1043. primarily to the efforts of ┤gross-increase neg?- if scapegoat else "our
  1044. beloved and industrious president" endif print▓.
  1045.      As the newly appointed assistant to the president it is my sad duty
  1046. to inform you that the accident which my predecessor "Uncle" Ned
  1047. suffered in front of my office will prevent him from resuming his duties
  1048. for at least the next 3 months.
  1049.  
  1050.                                              Sincerely,
  1051.  
  1052.  
  1053.  
  1054.                                              Albert Smith
  1055.                                              (Ambitious Al)
  1056.  
  1057.  
  1058. ┤326000 to current-gross
  1059. 380000 to past-gross
  1060. current-gross past-gross - to gross-increase
  1061.  
  1062. "our newest employee" to scapegoat
  1063. "Z,ZZZ" to format
  1064. ╖Dear Stockholder,
  1065.  
  1066.      The gross sales for this quarter was $┤current-gross =▓. This is
  1067. ┤gross-increase neg?- if "a decrease" else "an increase" endif print▓ of
  1068. ┤gross-increase abs "$" print =▓. This change in gross sales is due
  1069. primarily to the efforts of ┤gross-increase neg?- if scapegoat else "our
  1070. beloved and industrious president" endif print▓.
  1071.      As the newly appointed assistant to the president it is my sad duty
  1072. to inform you that the accident which my predecessor "Uncle" Ned
  1073. suffered in front of my office will prevent him from resuming his duties
  1074. for at least the next 3 months.
  1075.  
  1076.                                              Sincerely,
  1077.  
  1078.  
  1079.  
  1080.                                              Albert Smith
  1081.                                              (Ambitious Al)
  1082.  
  1083. ┤tof▓
  1084.  
  1085. ßGETTING DATA FROM A MERGE FILE 
  1086.  
  1087.      The form letters which were shown in the previous section have one
  1088. major fault. It is neccessary to edit the file and change the values of
  1089. the variables for each letter that is printed. A much more powerfull way
  1090. to generate form letters is to put the data in a separate file called a
  1091. "merge file" and have the computer automatically initialize the
  1092. variables from the data in the merge file at the start of each letter.
  1093. This allows a large number of customized letters to be printed with no
  1094. interaction required from the user.
  1095.      The modification neccessary in the text file in order to use mail
  1096. merge consists of simply modifying each command that assigns a constant
  1097. or string to a variable so that the constant or string which is assigned
  1098. to the variable comes from the merge file instead of from the text file.
  1099. The command which does this is called "get". Thus the in the previous
  1100. example, the phrase "326000 to current-gross" would be replaced by the
  1101. phrase "get current-gross", the phrase "380000 to past-gross" would be
  1102. replaced by the phrase "get past-gross", and the phrase ""our newest
  1103. employee" to scapegoat" would be replaced by the phrase "get scapegoat".
  1104.  
  1105. ßLOOPS 
  1106.  
  1107.      It is often desireable to search through the merge file for data
  1108. which meets certain conditions and only print letters when those
  1109. conditions are met. For example, if you want to advertise a trade show
  1110. which is only of local interest, it might be nice to send letters to
  1111. just those people with zip codes in a certain range. The "LOOP"
  1112. structure gives you the ability to collect data from the merge file,
  1113. test it, and continue going back for more data until the data satisfies
  1114. your conditions so that a letter can be printed.
  1115.      The following example shows how code would be written to accomplish
  1116. the task just described. ╡
  1117. begin
  1118.   get name
  1119.   get street
  1120.   get city
  1121.   get state
  1122.   get zip
  1123.   zip 45000 greater-than
  1124.   zip 46000 less-than
  1125.   and
  1126. repeat-until
  1127.  
  1128. ╖     In the example shown, the program gets all the information from the
  1129. merge file and then performs a test to see whether the information is to
  1130. be used or not. If it is NOT to be used, the program will jump back to
  1131. the word begin and will gather information for another person. As soon
  1132. as the conditions are met the program will continue with the printing of
  1133. the letter using the values just collected for the variables.
  1134.      The test portion of the code which was just shown needs further
  1135. clarification. The test in this case indicates a true responce when the
  1136. zip code is greater than 45000 and less than 46000. It should be noted
  1137. that two separate tests are performed and both tests must be true for
  1138. the conditions to be met.
  1139.      In each test the arguments being tested preceed the test itself.
  1140. THIS IS EXTREMILY IMPORTANT. The program will not operate correctly if
  1141. the order is changed. For example, in the code "zip 45000 greater-than"
  1142. the value of the zip code comes first (zip), then the value which it
  1143. will be compared to comes (45000), and finally the comparison is made
  1144. (greater-than). This comparison returns a condition of either true or
  1145. false. The second test behaves in a similar manner and returns a
  1146. condition of true or false. The second condition will be met whenever
  1147. the zip code is less than 46000.
  1148.      After both conditions are tested for, the word "and" provides a
  1149. third test. In this case the word "and" will return a true indication if
  1150. both of the previous tests returned a true indication and it will return
  1151. a false indication if either or both of the previous tests returned a
  1152. false indication. Again it is important to note that the two previous
  1153. tests must be completed before the "and" test is made. The "or" command
  1154. is similar to the "and" command. In this case only one of the previous
  1155. tests has to be true for the "or" condition to be true.
  1156.      If the letter was to be sent to everyone in the merge file EXCEPT
  1157. those people within the given zip code range, the code could be modified
  1158. by replacing the word "repeat-until" with the word "repeat-while". In
  1159. this case the code would look like the following. ╡
  1160. begin
  1161.   get name
  1162.   get street
  1163.   get city
  1164.   get state
  1165.   get zip
  1166.   zip 45000 greater-than
  1167.   zip 46000 less-than
  1168.   and
  1169. repeat-while
  1170.  
  1171. ßCREATING A MERGE FILE 
  1172.  
  1173.      Once the text file is modified so that it looks for input from a
  1174. merge file, the text file can be saved and a separate merge file can be
  1175. created. The merge file is simply a text file that contains the data
  1176. needed by the text file. The data must be entered in the same order that
  1177. it is requested by the document. Numeric data may be separated either by
  1178. spaces or by placing each number on a separate line. Strings must be
  1179. separated by placing each string on a separate line.
  1180.      Blank lines may be inserted if desired for readability but they
  1181. will be ignored by the program. In other words, if the program tries to
  1182. read the value for a numeric or string variable, it will keep skipping
  1183. lines until it finds a line with data on it.
  1184.      When a document is being printed and a merge file is specified, the
  1185. document will be printed again and again using different data each time
  1186. until either the file is exhausted or the user stops the printing by
  1187. typing a carriage return.
  1188.  
  1189. αCHAPTER 5: UTILITIES 
  1190.  
  1191.      A number of utilities are included with Wordwright which aren't a
  1192. neccesary part of the word processor but add a lot to the usefulness of
  1193. it.
  1194.  
  1195. ßCLI 
  1196.  
  1197.      It is frequently usefull to access system utilities from within
  1198. Wordwright. The most common system utility "dir" may be called from the
  1199. "UTILITIES" window by simply typing in the word "dir" with an optional
  1200. drive or path name. This will start a new CLI (Command Line Interface)
  1201. and execute the dir command. After the dir command is executed, the new
  1202. CLI will remain until a return is typed with nothing in the line.
  1203.      If you want to execute a system command other than dir, you may
  1204. create a new CLI without first executing the dir command by typing the
  1205. command "CLI". Both the dir and cli commands are also available from the
  1206. edit mode by using pull down menus.
  1207.  
  1208. ßCALCULATOR 
  1209.  
  1210.      The utilities window contains a simple calculator which is intended
  1211. primarily as an aid to programmers. It is a four function calculator
  1212. which works only with integers but can perform calculations in either
  1213. the decimal mode or the hexadecimal mode. It can also convert from one
  1214. base to another and can give the ascii representation for any key which
  1215. is pressed.
  1216.      The calculator uses Reverse Polish Notation or RPN. RPN is the way
  1217. functions are entered in calculators made by Hewlett Packard and it
  1218. differs from algebraic notation in that functions are entered after
  1219. numbers instead of between numbers. The following example illustrates
  1220. the keys which would be typed in both algebraic notation and RPN to add,
  1221. subtract, multiply, or divide two numbers.
  1222.  
  1223.      ALGEBRAIC                 RPN
  1224.  
  1225.      2 + 2 =                   2 2 + =
  1226.      5 - 3 =                   5 3 - =
  1227.      3 * 4 =                   3 4 * =
  1228.      8 / 2 =                   8 2 / =
  1229.  
  1230.      It should be noted that there must be a space between numbers and
  1231. functions.
  1232.      The calculator works in both the decimal and hexadecimal modes and
  1233. you can switch from one mode to the other by typing the words "decimal"
  1234. or "hex". If you want to convert a decimal number to hexadecimal you
  1235. would make sure that you are in the decimal mode, enter your number,
  1236. type "hex" to enter the hexadecimal mode, and print the number by typing
  1237. an equal sign.
  1238.      If you want to know what the ascii representation is for a
  1239. particular key, you may type the word "key?" followed by a carriage
  1240. return. The computer will then wait for you to press the next key and
  1241. will type the ascii representation for the character or characters that
  1242. are sent to the computer when that key is typed. The ascii
  1243. representation can be given in either the decimal mode or the
  1244. hexadecimal mode depending on which number base is selected at the time.
  1245.  
  1246. ßDUMP 
  1247.  
  1248.      It is sometimes usefull to see a memory dump of text to show
  1249. unprintable characters such as tabs or characters which are embedded to
  1250. change the screen color. The dump command is used to print the contents
  1251. of any area of memory in the computer. If you know the address where you
  1252. want to start your dump, you just type the address followed by a space
  1253. and the word "dump". If you don't know the address, you can use a
  1254. symbolic address such as sof, eof, or current. These symbolic addresses
  1255. refer to the start of file, end of file, and cursor location
  1256. respectively. If you wanted to start the dump 10 characters in front of
  1257. the cursor, you would type "current 10 - dump".
  1258.      The dump may be stopped and restarted by typing the space bar. When
  1259. you want to stop the dump completely and have no desire to restart it,
  1260. hit the return key.
  1261.  
  1262. ßSCREEN SAVER 
  1263.  
  1264.      The screen saver isn't a utility that is deliberatly used, but
  1265. instead is a feature that is always present in the background of
  1266. Wordwright. The function of the screen saver is to monitor the activity
  1267. from the keyboard to determine whether someone is actually using
  1268. Wordwright or whether the computer is just sitting idle. If 5 minutes
  1269. goes by with no input from the keyboard, the computer assumes that
  1270. nobody is using the computer and will turn off the display except for
  1271. the pointer, which will be left on as an indicator to show that the
  1272. computer is still turned on. The purpose of the screen saver is to
  1273. prolong the life of your monitor.
  1274.      If the screen turns off, you may turn it back on by hitting any
  1275. key. The key will only be interpreted as a command to turn on the screen
  1276. and will not affect any text which is being edited.
  1277.      The length of time necessary to turn off the screen is adjustable
  1278. by the user. To adjust the time, go to the utilities window and type the
  1279. command "N to screen-timer" where N is the number of seconds that you
  1280. want to wait before the computer turns the monitor off. For example, the
  1281. command "5 60 * to screen-timer" will set the timer for 5 minutes. If
  1282. you plan to run another program at the same time Wordwright is running,
  1283. you are likely to go for a long time without typing any input to
  1284. Wordwright, but you still won't want the screen to turn off. The screen
  1285. saver can be disabled by setting the screen-timer to 0.
  1286.  
  1287. ┤contents▓